﻿<%@ Page Language="C#" MasterPageFile="~/SubForm.Master" AutoEventWireup="true" Codebehind="Help.aspx.cs"
    Inherits="PreContractWeb.Task.Help" Title="Help Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
    
<table border="0" cellpadding="0" cellspacing="0" width="97%" align="center">
  <tr>
    <td width="100%" height="100%" valign="middle" align="center"><br />
    
    <div id="divManager" runat="server" width="100%">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="panel_header">
                <!--标题-->
                    上传帮助文件(Upload Help File)
                                    <!--标题-->
                </td><td width="5" rowspan="2" background="../Images/BG-Border-Right.png" valign="top"><img src="../Images/BG-Border-RT.png" border="0"/></td>
            </tr>
            <tr>
                <td class="panel_body" >
                    <!--Panel Body-->
                    
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            
                            <tr>
                                <td>
                                    <!--Panel Body-->
                                    <table style="width: 97%">
                                        <tr>
                                           
                                            <td style="text-align: left; width: 10%">
                                                &nbsp;文件:<br />
                                                &nbsp;File:</td>
                                            <td align="left" isvalidate="true" colspan="2">
                                                <asp:FileUpload ID="uplFile" runat="server" Width="555"  allowempty="false" /></td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: left; width: 10%;">
                                                &nbsp;描述:<br />
                                                &nbsp;Description:
                                            </td>
                                            <td style="text-align: left; width: 60%;">
                                                <asp:TextBox ID="txtDescription" runat="server" allowempty="false" CssClass="cssText" checkmaster="checkbadwords"
                                                    Width="500"></asp:TextBox>
                                                <b class="required">*</b></td>
                                            <td align="right">
                                                <asp:Button ID="btnUpload" CssClass="bgButton" runat="server" Text="上传 (Upload)"
                                                    OnClick="btnUpload_Click" isvalidate="true" />
                                                <asp:Button ID="btnDelete" runat="server" CssClass="bgButton" Text="删除(Delete)" OnClick="btnDelete_Click" /></td>
                                        </tr>
                                    </table>
                                    <!---->
                                </td>
                            </tr>

                        </table>
                 
                    
                </td>
            </tr>
            <tr>
                <td height="5" background="../Images/BG-Border-Bottom.png" align="left"><img src="../Images/BG-Border-LB.png" border="0"/></td>
        <td width="5" height="5" background="../Images/BG-Border-RB.png"></td>
            </tr>
        </table>
    </div>
     
     
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="panel_header">
            <!--标题-->
                            帮助文件列表(Help File List)
                            <!--标题-->
            <!--标题-->
            </td><td width="5" rowspan="2" background="../Images/BG-Border-Right.png" valign="top"><img src="../Images/BG-Border-RT.png" border="0"/></td>
        </tr>
        <tr>
            <td class="panel_body" >
               <br />
                <div id="divReport" style="overflow:auto;" >                  
                    <table width="100%" align="center">
                    <tr>
                        <td>
                                <asp:GridView ID="gvHelp" runat="server" AutoGenerateColumns="False" DataKeyNames="DocID"
                                    PageSize="20" Width="97%">
                                    <PagerSettings Visible="False" />
                                    <EmptyDataTemplate>
                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td class="panel_header">
                                                    <!--标题-->
                                                    没有数据(No Data).
                                                    <!--标题-->
                                                </td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                    <Columns>
                                        <asp:TemplateField>
                                            <HeaderTemplate>
                                                <input id="chkAll" name="chkAll" onclick="javascript: return CheckAll(this.checked, this.id);"
                                                    type="checkbox" />
                                            </HeaderTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <HeaderStyle Wrap="False" />
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkSelect" runat="server" onClick="javascript: return CheckAll(this.checked, this.id);" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="DocDescription" HeaderText="描述&lt;br/&gt;Description"
                                            HtmlEncode="False">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="DateCreated" DataFormatString="{0:yyyy-MM-dd}" HeaderText="上传时间&lt;br/&gt;Upload Date"
                                            HtmlEncode="False">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="下载&lt;br/&gt;Download">
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <a id="link" runat="server" href='<%#Bind("DocPath")%>' target="_top">
                                                    <asp:Image ID="Image1" runat="server" ImageUrl="../images/COMEDIT.GIF" /></a>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="DocPath" Visible="false">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                    </Columns>
                                    <RowStyle CssClass="table_row_1" Height="20px" />
                                    <SelectedRowStyle CssClass="SelectedRow" />
                                    <HeaderStyle CssClass="table_header" />
                                    <AlternatingRowStyle CssClass="table_row_2" />
                                </asp:GridView>
                        </td>
                    </tr>
                    </table>
                </div>
            
        </td>
    </tr>
    </table>
    </td>
  </tr>
</table>


    <script language="javascript">

    window.attachEvent("onresize",resizeFunc1); 
    resizeFunc1();
    
    function resizeFunc1()
    {
        var divUpload=document.getElementById("ctl00_ContentPlaceHolder1_divManager");
        
        if (divUpload==null)     
        {   
            //alert();
            //alert();
            //non admin and in new window
            //alert();
            var divRpt=document.getElementById("divReport");
            if (divRpt!=null)
            {
                divRpt.style.width = document.documentElement.clientWidth-30;
                divRpt.style.height = document.documentElement.clientHeight-100; 
            }  
        }
        else
        {
            
            if (window.opener!=null)
            {
                //admin in new window 
                //alert("1");
                var divRpt=document.getElementById("divReport");

                if (divRpt!=null)
                {
                    divRpt.style.width = document.documentElement.clientWidth-30;
                    divRpt.style.height = document.documentElement.clientHeight-210; 
                }  
            
            }
            else
            {
                //alert("2");
                var parentWin=window.parent;
                if (parentWin!=null)
                {
                    var ofrm=parentWin.document.getElementById("main");
                    if (ofrm!=null)
                    {
                        var sHeight=ofrm.document.body.offsetHeight;
                        var sWidth=ofrm.document.body.offsetWidth;
                       
                        var divRpt=document.getElementById("divReport");

                        if (divRpt!=null)
                        {
                            divRpt.style.width=sWidth-250;
                            divRpt.style.height=sHeight-305;
                        }
                    }
                }
            }
        }
    }  
    function OnRptDelete()
    {
        var chkList=document.documentElement.getElementsByTagName("INPUT");
        var chk;
        var n=0;
        

        for (var i=0;i<chkList.length;i++)
        {
            chk=chkList[i];
            if (chk.type=="checkbox" && chk.id!=="chkAll")
            {
                if (chk.checked)
                    n++;
            }
            
        }
        if (n==0)
            alert("请选择至少一项!\n Please select at least one item!");
        else
        {
            if (confirm("确认删除所选项吗？\nAre you sure to delete selected item(s)?"))
            {
                var btn=document.getElementById("ctl00_ContentPlaceHolder1_btnDelete");
                btn.removeAttribute("autopostback");
            }
        }
    }
    </script>

</asp:Content>
